<?php
$Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
?>
<table width="490" border="0" cellspacing="0" cellpadding="0" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; " align="center">
  <tr style=" border:1px solid #CCCCCC; ">
  <td colspan="2"  class="TitleStat">Information sur le support   </td>
  </tr>
     <?php
 $Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
 $NbMac=0;
while($rowM=mysql_fetch_array($Support)){
$SupportM=$rowM['Agent'];
	if(eregi('Mac', $SupportM) && (!eregi('iPhone', $SupportM) && !eregi('iPad', $SupportM))){
	$NbMac++;
	}
}
?>
     <tr style=" border:1px solid #CCCCCC; ">
     <td width="187" style=" border-bottom:1px solid #CCCCCC; "><img src="./images/iconesStat/Mac.jpg" width="20" height="20" > Ouverts d'un Mac </td>
     <td style="text-align:left; font-size:24px; border-bottom:1px solid #CCCCCC; "><?php 
	$RatioM=(($NbMac)*100)/$nbEmailTotal;
  	echo sprintf("%.2f",$RatioM)." % <font style='font-size:12px;'>soit ".$NbMac." ouvertures</font>"; ?></td>
   </tr>

<?php
 $Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
 $NbPC=0;
while($rowP=mysql_fetch_array($Support)){
$SupportP=$rowP['Agent'];
	if(eregi('Windows', $SupportP)){
	$NbPC++;
	}
}
?>
   <tr style=" border:1px solid #CCCCCC; ">
     <td width="187" style=" border-bottom:1px solid #CCCCCC; "><img src="./images/iconesStat/Windows.jpg" width="20" height="20"> Ouverts d'unPC Windows </td>
     <td style="text-align:left; font-size:24px; border-bottom:1px solid #CCCCCC; "><?php 
	$RatioP=(($NbPC)*100)/$nbEmailTotal;
  	echo sprintf("%.2f",$RatioP)." % <font style='font-size:12px;'>soit ".$NbPC." ouvertures</font>"; ?></td>
   </tr>

<?php
 $Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
 $NbSmart=0;
while($rowNS=mysql_fetch_array($Support)){
$SupportS=$rowNS['Agent'];
	if(eregi('Android', $SupportS) || eregi('BlackBerry', $SupportS) || eregi('Symbian', $SupportS)){
	$NbSmart++;
	}
}
?>
   <tr style=" border:1px solid #CCCCCC; ">
  <td width="187" style=" border-bottom:1px solid #CCCCCC; "><img src="./images/iconesStat/Smart.jpg" width="20" height="20"> Ouverts d'un Smartphone </td>
  <td width="303" style="text-align:left; font-size:24px; border-bottom:1px solid #CCCCCC; "><?php 
	$RatioNS=(($NbSmart)*100)/$nbEmailTotal;
  	echo sprintf("%.2f",$RatioNS)." % <font style='font-size:12px;'>soit ".$NbSmart." ouvertures</font>"; ?></td>
  </tr>
  
 <?php
  $Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
  $NbIphone=0;
while($rowNI=mysql_fetch_array($Support)){
$SupportI=$rowNI['Agent'];
	if(eregi('iPhone', $SupportI)){
	$NbIphone++;
	}
}
?>
  <tr style=" border:1px solid #CCCCCC; ">
    <td width="187"  style=" border-bottom:1px solid #CCCCCC; "><img src="./images/iconesStat/IPhone.jpg" width="20" height="20"> Ouverts d'un IPHONE  </td>
    <td style="text-align:left; font-size:24px; border-bottom:1px solid #CCCCCC;  "><?php 
	$RatioNI=(($NbIphone)*100)/$nbEmailTotal;
  	echo sprintf("%.2f",$RatioNI)." % <font style='font-size:12px;'>soit ".$NbIphone." ouvertures</font>"; ?></td>
  </tr>
  
<?php
 $Support=mysql_query("SELECT * FROM $NomTable ORDER BY idEmail") or die(mysql_error());
 $NbIpad=0;
while($rowIpad=mysql_fetch_array($Support)){
$SupportIpad=$rowIpad['Agent'];
	if(eregi('Ipad', $SupportIpad)){
	$NbIpad++;
	}
}
?>
   <tr style=" border:1px solid #CCCCCC; ">
  <td width="187" style=" border-bottom:1px solid #CCCCCC; "><img src="./images/iconesStat/IPad.jpg" width="20" height="20"> Ouverts d'un IPad </td>
  <td width="303" style="text-align:left; font-size:24px; border-bottom:1px solid #CCCCCC; "><?php 
	$RatioIpad=(($NbIpad)*100)/$nbEmailTotal;
  	echo sprintf("%.2f",$RatioIpad)." % <font style='font-size:12px;'>soit ".$NbIpad." ouvertures</font>"; ?></td>
  </tr>
</table>
<div class="LogoStat">
	<div class="IconeStat" style="margin:0px 0 0 0;" >
	<img src="./images/iconesStat/Mac.jpg" ><img src="./images/iconesStat/BGMac.jpg" >
	</div>
	<div class="IconeStat">
	<img src="./images/iconesStat/Windows.jpg"><img src="./images/iconesStat/BGWindows.jpg">
	</div>
	<div class="IconeStat">
	<img src="./images/iconesStat/Smart.jpg"><img src="./images/iconesStat/BGSmart.jpg"></div>
	<div class="IconeStat">
	<img src="./images/iconesStat/IPhone.jpg"><img src="./images/iconesStat/BGIPhone.jpg"></div>
	<div class="IconeStat">
	<img src="./images/iconesStat/IPad.jpg"><img src="./images/iconesStat/BGIpad.jpg">
	</div>
	<div class="IconeStat">
	<img src="./images/iconesStat/Autres.jpg"><img src="./images/iconesStat/BGA.jpg">
	</div>
	<div class="clr"></div>
</div>
<?php
$PrcM=sprintf("%.2f",$RatioM);
$WMac=$PrcM*450/100;

$PrcW=sprintf("%.2f",$RatioP);
$WWin=$PrcW*450/100;

$PrcS=sprintf("%.2f",$RatioNS);
$WS=$PrcS*450/100;

$PrcI=sprintf("%.2f",$RatioNI);
$WI=$PrcI*450/100;

$PrcIpad=sprintf("%.2f",$RatioIpad);
$WIpad=$PrcIpad*450/100;
?>
<div class="ContainStat1">

<div class="Pourcent1" style="width:<?php echo $WMac; ?>px;"></div>
<div class="Pourcent1W" style="width:<?php echo $WWin; ?>px;"></div>
<div class="Pourcent1S" style="width:<?php echo $WS; ?>px;"></div>
<div class="Pourcent1I" style="width:<?php echo $WI; ?>px;"></div>
<div class="Pourcent1Ipad" style="width:<?php echo $WIpad; ?>px;"></div>
<div class="clr"></div>
</div>